<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Security and SLM | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'slm-and-security.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/slm-and-security.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/slm-and-security.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/slm-and-security.html" rel="nofollow" target="_blank">../en/slm-and-security.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="snapshot-restore.html">Snapshot and restore</a></span>
»
<span class="breadcrumb-link"><a href="snapshot-lifecycle-management.html">SLM: Manage the snapshot lifecycle</a></span>
»
<span class="breadcrumb-node">Security and SLM</span>
</div>
<div class="navheader">
<span class="prev">
<a href="getting-started-snapshot-lifecycle-management.html">« Tutorial: Automate backups with SLM</a>
</span>
<span class="next">
<a href="slm-retention.html">Snapshot retention »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="slm-and-security"></a>Security and SLM<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/slm/slm-security.asciidoc">edit</a>
</h2>
</div></div></div>
<p>Two built-in cluster privileges control access to the SLM actions when
Elasticsearch security features are enabled:</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">manage_slm</code>
</span>
</dt>
<dd>
Allows a user to perform all SLM actions, including creating and updating policies
and starting and stopping SLM.
</dd>
<dt>
<span class="term">
<code class="literal">read_slm</code>
</span>
</dt>
<dd>
Allows a user to perform all read-only SLM actions,
such as getting policies and checking the SLM status.
</dd>
<dt>
<span class="term">
<code class="literal">cluster:admin/snapshot/*</code>
</span>
</dt>
<dd>
Allows a user to take and delete snapshots of any
index, whether or not they have access to that index.
</dd>
</dl>
</div>
<p>You can create and manage roles to assign these privileges through Kibana Management.</p>
<p>To grant the privileges necessary to create and manage SLM policies and snapshots,
you can set up a role with the <code class="literal">manage_slm</code> and <code class="literal">cluster:admin/snapshot/*</code> cluster privileges
and full access to the SLM history indices.</p>
<p>For example, the following request creates an <code class="literal">slm-admin</code> role:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST /_security/role/slm-admin
{
  "cluster": ["manage_slm", "cluster:admin/snapshot/*"],
  "indices": [
    {
      "names": [".slm-history-*"],
      "privileges": ["all"]
    }
  ]
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1215.console"></div>
<p>To grant read-only access to SLM policies and the snapshot history,
you can set up a role with the <code class="literal">read_slm</code> cluster privilege and read access
to the snapshot lifecycle management history indices.</p>
<p>For example, the following request creates a <code class="literal">slm-read-only</code> role:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST /_security/role/slm-read-only
{
  "cluster": ["read_slm"],
  "indices": [
    {
      "names": [".slm-history-*"],
      "privileges": ["read"]
    }
  ]
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1216.console"></div>
</div>
<div class="navfooter">
<span class="prev">
<a href="getting-started-snapshot-lifecycle-management.html">« Tutorial: Automate backups with SLM</a>
</span>
<span class="next">
<a href="slm-retention.html">Snapshot retention »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>